//
//  TryHoneCacheManager.h
//  TryHoneBase
//
//  Created by TryHone on 17/6/16.
//  Copyright © 2017年 TryHone. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "JFCachelModel.h"


@interface JFCacheManager : NSObject

+(NSString*)defaultEngineName;

//初始化一个引擎到内存
+(void)createEngine:(NSString*)engineName type:(CacheEngine)type;
/**
 *  @author Alan, 17-06-16 17:06:58
 *
 *  @brief 把数据存储到缓存
 *
 *  @param model 缓存模型
 */
+(void)sendDataToCacheWithModel:(JFCachelModel*)model;

/**
 *  @author Alan, 17-06-16 17:06:58
 *
 *  @brief 把数据存储到默认引擎默认引擎名下，该方法覆盖实现sendDataToCacheWithModel方法，如果id 值类型是TryHoneCachelModel key可以传nil
 *
 */
+(void)sendDataToCache:(id)data key:(NSString*)key;

/**
 *  @author Alan, 17-06-16 17:06:22
 *
 *  @brief 从默认缓存引擎中获取数据(先从YYCache中取，取不到会从NSUserDefaults中取)
 *
 *  @param key key description
 *
 *  @return return value description
 */
+(JFCachelModel*)vauleDataFromCacheWithKey:(NSString*)key;
/**
 *  @author Alan, 17-06-16 17:06:26
 *
 *  @brief  从engineName缓存引擎中获取数据(先从YYCache中取，取不到会从NSUserDefaults中取,YYCache或者NSUserDefaults 引擎不存在的会创建并缓存到内存)
 *
 *  @param engineName 获取数据的缓存引擎
 *  @param key        key
 *
 *  @return 返回数据模型
 */
+(JFCachelModel*)vauleDataFromCache:(NSString*)engineName key:(NSString*)key;
/**
 *  @author Alan, 17-06-28 10:06:06
 *
 *  @brief 从指定引擎获取值
 *
 *  @param engineName 引擎名
 *  @param key        key
 *
 *  @return 返回缓存的值
 */
+(id)vauleDataFromYYCache:(NSString*)engineName key:(NSString*)key;
/**
 *  @author Alan, 17-06-28 10:06:06
 *
 *  @brief 从指定引擎获取值
 *
 *  @param engineName 引擎名
 *  @param key        key
 *
 *  @return 返回缓存的值
 */
+(id)vauleDataFromNSUserdefault:(NSString*)engineName key:(NSString*)key;
/**
 *  @author Alan, 17-06-17 14:06:18
 *
 *  @brief 移除默认引擎名key混存值(会移除YYCache,NSUserDefaults中key的值 )
 *
 *  @param key <#key description#>
 */
+(void)removeObjectForKey:(NSString*)key;

/**
 *  @author Alan, 17-06-17 14:06:18
 *
 *  @brief 从指定引擎名移除指定key值
 *
 *  @param key key
 */
+(void)removeObjectFrom:(NSString*)engine key:(NSString*)key;
/**
 *  @author Alan, 17-06-17 14:06:07
 *
 *  @brief 从YYCache,NSUserDefaults 默认引擎名移除所有的缓存值
 */
+(void)removeAllObjectFromDefaultEngin;

/**
 *  @author Alan, 17-06-17 14:06:07
 *
 *  @brief 从YYCache,NSUserDefaults 默认引擎名移除所有的缓存值
 */
+(void)removeAllObjectFrom:(NSString*)engine;

@end
